<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jsx小练习</title>
</head>
<body>
  <!-- 容器 -->
  <div id="test"></div>

  <!-- react核心库 -->
  <script type="text/javascript" src="../js/react.development.js"></script>
  <!-- dom操作扩展库 -->
  <script type="text/javascript" src="../js/react-dom.development.js"></script>
  <!-- jsx转js -->
  <script type="text/javascript" src="../js/babel.min.js"></script>

  <script type="text/babel">
    // 模拟数据
    const data = ['Angular', 'React', 'Vue']

    // 创建虚拟DOM
    const VDOM = (
      <div id="box">
        <h2>前端JS框架列表</h2>
        <ul>
          {
            data.map((item, index)=>{
              return <li key={index}>{item}</li>
            })
          }
        </ul>
      </div>
    )
    // 将虚拟DOM渲染到网页
    ReactDOM.render(VDOM, document.getElementById('test'))
  </script>

</body>
</html>